export const checkHarmonyPermissions = () => {
  return new Promise((resolve, reject) => {
    // #ifdef APP-PLUS
    if (plus.os.name.toLowerCase() === 'android') {
      plus.runtime.getProperty(plus.runtime.appid, (widgetInfo) => {
        const ua = widgetInfo.version
        if (ua.indexOf('HarmonyOS') > -1) {
          plus.harmony.requestPermissions({
            permissions: ['ohos.permission.GET_BUNDLE_INFO'],
            success: (result) => {
              resolve(result)
            },
            fail: (error) => {
              reject(error)
            }
          })
        } else {
          resolve()
        }
      })
    } else {
      resolve()
    }
    // #endif
    
    // #ifdef H5 || MP
    resolve()
    // #endif
  })
}